<% if policy(:user).isAdmin? %>

    <li class="open">
      <a href="#" class="dropdown-toggle">
        <i class="menu-icon fa fa-desktop"></i>
                                <span class="menu-text">
                                    商品库
                                </span>
        <b class="arrow fa fa-angle-down"></b>
      </a>

      <b class="arrow"></b>

      <ul class="submenu">

        <li class="">
          <a data-href="<%= parent_index_products_path %>">
            <i class="menu-icon fa fa-caret-right"></i>
            上架总部商品
          </a>

          <b class="arrow"></b>
        </li>

        <li class="">
          <a data-href="<%= products_path(:state => 'online') %>">
            <i class="menu-icon fa fa-caret-right"></i>
            出售中的商品
          </a>

          <b class="arrow"></b>
        </li>

        <li class="">
          <a data-href="<%= products_path(:state => 'restocking') %>">
            <i class="menu-icon fa fa-caret-right"></i>
            已售罄的商品
          </a>

          <b class="arrow"></b>
        </li>

        <li class="">
          <a data-href="<%= products_path(:state => 'alarm') %>">
            <i class="menu-icon fa fa-caret-right"></i>
            库存告警商品
          </a>

          <b class="arrow"></b>
        </li>

        <li class="">
          <a data-href="<%= products_path(:state => 'offline') %>">
            <i class="menu-icon fa fa-caret-right"></i>
            仓库中的商品
          </a>

          <b class="arrow"></b>
        </li>

      </ul>
    </li>
<% end %>

<% if current_user.has_role?(:store) %>
    <li class="">
      <a href="#" class="dropdown-toggle">
        <i class="menu-icon fa fa-desktop"></i>

                                <span class="menu-text">
                                    订单管理
                                </span>
        <b class="arrow fa fa-angle-down"></b>
      </a>
      <b class="arrow"></b>
      <ul class="submenu">
        <li class="">
          <a data-href="<%= orders_path(:workflow_state => "paid") %>">
            <i class="menu-icon fa fa-caret-right"></i>
            订单管理
          </a>
          <b class="arrow"></b>
        </li>
      </ul>
    </li>
<% end %>


<% if current_user.has_role?(:admin) %>

    <li class="">
      <a href="#" class="dropdown-toggle">
        <i class="menu-icon fa fa-desktop"></i>
        <span class="menu-text">数据中心</span>
        <b class="arrow fa fa-angle-down"></b>
      </a>

      <b class="arrow"></b>
      <ul class="submenu">

        <li class="">
          <a data-href="<%= statistic_orders_path %>">
            <i class="menu-icon fa fa-caret-right"></i>
            订单统计
          </a>

          <b class="arrow"></b>
        </li>

        <li class="">
          <a data-href="<%= share_integral_records_path %>">
            <i class="menu-icon fa fa-caret-right"></i>
            推荐查询
          </a>

          <b class="arrow"></b>
        </li>

        <li class="">
          <a data-href="/customers/index">
            <i class="menu-icon fa fa-caret-right"></i>
            本地会员查询
          </a>
          <b class="arrow"></b>
        </li>
      </ul>
    </li>

    <% if current_user.has_role?(:static_data_admin) %>
    <!--数据统计开始-->
    <li class="">
      <a href="#" class="dropdown-toggle">
        <i class="menu-icon fa fa-desktop"></i>
        <span class="menu-text">统计中心</span>
        <b class="arrow fa fa-angle-down"></b>
      </a>

      <b class="arrow"></b>
      <ul class="submenu">

        <li class="">
          <a data-href="<%= jyd_statistics_path %>">
            <i class="menu-icon fa fa-caret-right"></i>
            各门店日订单量统计
          </a>

          <b class="arrow"></b>
        </li>

        <li class="">
          <a data-href="<%= month_order_data_jyd_statistics_path %>">
            <i class="menu-icon fa fa-caret-right"></i>
            各门店月订单量统计
          </a>

          <b class="arrow"></b>
        </li>

        <li class="">
          <a data-href="<%= purchase_users_jyd_statistics_path %>">
            <i class="menu-icon fa fa-caret-right"></i>
            各门店日下单用户数统计
          </a>

          <b class="arrow"></b>
        </li>
      </ul>
    </li>
    <!--数据统计结束-->
    <% end %>

    <li class="">
      <a href="#" class="dropdown-toggle">
        <i class="menu-icon fa fa-desktop"></i>
        <span class="menu-text">系统管理</span>
        <b class="arrow fa fa-angle-down"></b>
      </a>

      <b class="arrow"></b>
      <ul class="submenu">

        <li class="">
          <a data-href="<%= stores_path %>">
            <i class="menu-icon fa fa-caret-right"></i>
            门店管理
          </a>

          <b class="arrow"></b>
        </li>

        <li class="">
          <a data-href="<%= admin_users_path %>">
            <i class="menu-icon fa fa-caret-right"></i>
            用户管理
          </a>
          <b class="arrow"></b>
        </li>

        <li class="">
          <a data-href="<%= delivery_users_path %>">
            <i class="menu-icon fa fa-caret-right"></i>
            配送员管理
          </a>
          <b class="arrow"></b>
        </li>

        <li class="">
          <a data-href="/userinfos/<%= current_user['userinfo_id'] %>/edit/">
            <i class="menu-icon fa fa-caret-right"></i>
            基本信息维护
          </a>
          <b class="arrow"></b>
        </li>

      </ul>
    </li>







    <% if current_user.has_role?(:business_integral) %>
        <li class="">
          <a href="#" class="dropdown-toggle">
            <i class="menu-icon fa fa-desktop"></i>

                                <span class="menu-text">
                                    积分管理
                                </span>
            <b class="arrow fa fa-angle-down"></b>
          </a>
          <b class="arrow"></b>
          <ul class="submenu">
            <li class="">
              <a data-href="<%= user_integrals_path %>">
                <i class="menu-icon fa fa-caret-right"></i>
                我的积分
              </a>
              <b class="arrow"></b>
            </li>
            <li class="">
              <a data-href="<%= user_integral_purchases_path %>">
                <i class="menu-icon fa fa-caret-right"></i>
                积分充值
              </a>
              <b class="arrow"></b>
            </li>
          </ul>
        </li>
    <% end %>

<% end %>